package LanQiao.jichu;

import java.util.Scanner;

//数组存放阶乘计算
public class BASIC_30 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int temp;//暂时存储数组每位结果
        int jw = 0;//进位值
        int i; // 用于定位
        int[] a = new int[10000];
        a[0] = 1;
        for ( i = 2; i <= n; i++) {
            for (int j = 0; j < a.length; j++) {
                temp = a[j] * i + jw; //先计算当前位值
                jw = temp / 10; //得出进位值
                a[j] = temp % 10; //将当前位赋正确的值
            }
        }
        //定位到阶乘数的最大位位置
        for (i = a.length - 1;i >= 0; i--) {
            if (a[i] != 0) {
                break;
            }
        }
        for (int i1 = i; i1 >= 0; i1--) {
            System.out.print(a[i1]);
        }
    }
}
